package com.xiaobing.crm.controller;

import com.xiaobing.common.exception.ExceptionCodeMsg;
import com.xiaobing.common.exception.ServiceException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 积分变更记录表 前端控制器
 * </p>
 *
 * @author tui
 * @since 2024-07-16
 */
@RestController
@RequestMapping("/test")
public class TestController {


    // 127.0.0.1:8080/test/test
    @GetMapping(value = "/test")
    public String test() {
        if (1 == 1) {
            // 测试全局异常
//            int a = 1/0;
            //测试自定义异常
            throw new ServiceException(ExceptionCodeMsg.FAILURE);
        }
        return "0000";
    }
}
